/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package EntityClass;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;

/**
 *
 * @author Ben
 */
@Entity
public class Cases implements Serializable {
    
    
        private Long Caseid;
        private Date date;
        private Nursing_Anamnesis nAnamnesis;
        private Medical_Anamnesis mAnamnesis;
        private Discharge discharge;
        private Transfer transfer;
        private Bed bed;
        private Collection<Appointment> appointments=
                new ArrayList<Appointment>();
        
    
    public Cases(){}
    
    @OneToOne(cascade={CascadeType.PERSIST})
    public Nursing_Anamnesis getnAnamnesis(){
        return nAnamnesis;
    }
    
    public void setnAnamnesis(Nursing_Anamnesis nAnamnesis){
        this.nAnamnesis=nAnamnesis;
    }
    
    @OneToOne(cascade={CascadeType.PERSIST})
    public Medical_Anamnesis getmAnamnesis(){
        return mAnamnesis;
    }
    
    public void setmAnamnesis(Medical_Anamnesis mAnamnesis){
        this.mAnamnesis=mAnamnesis;
    }
    
    @OneToOne(cascade={CascadeType.PERSIST})
    public Transfer getTransfer(){
        return transfer;
    }
    
    public void setTransfer(Transfer transfer){
        this.transfer=transfer;
    }
    
    @OneToOne(cascade={CascadeType.PERSIST})
    public Bed getBed(){
        return bed;
    }
    
    public void setBed(Bed bed){
        this.bed=bed;
    }
    
    @OneToOne(cascade={CascadeType.PERSIST})
    public Discharge getDischarge(){
        return discharge;
    }
    public void setDischarge(Discharge discharge){
        this.discharge=discharge;
    }
    
    @OneToMany(cascade={CascadeType.PERSIST})
    public Collection<Appointment> getAppointments(){
        return appointments;
    }
    
    public void setAppointment(Collection<Appointment> appointments){
        this.appointments=appointments;
    }
    
    
    @Id
    public Long getId() {
        return Caseid;
    }

    public void setId(Long Caseid) {
        this.Caseid = Caseid;
    }
    
    @Temporal(javax.persistence.TemporalType.DATE)
        public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }
   
    
}
